package com.bw.zh.view.adapter

import android.content.Context
import android.widget.CheckBox
import android.widget.ImageView
import android.widget.TextView
import com.blankj.utilcode.util.ToastUtils
import com.bumptech.glide.Glide
import com.bw.zh.R
import com.bw.zh.bean.SecondItemBean
import com.zhy.adapter.recyclerview.CommonAdapter
import com.zhy.adapter.recyclerview.base.ViewHolder
import org.greenrobot.eventbus.EventBus

/**
 *
 * @ClassName: HomeGoodsAdapter
 * @Description: java类作用描述
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/19 8:42 AM
 * @Version: 1.0
 */
class SecondHAdapter(context: Context?, layoutId: Int, data: MutableList<SecondItemBean>) :
    CommonAdapter<SecondItemBean>(context, layoutId, data) {
    override fun convert(holder: ViewHolder?, t: SecondItemBean?, position: Int) {
        holder?.setText(R.id.tv_name, t?.title)
        holder?.setText(R.id.tv_desc, t?.labelDesc)
        holder?.setText(R.id.tv_price, "¥${t?.price}")
        val img = holder?.getView<ImageView>(R.id.item_iv)
        img?.let { Glide.with(mContext).load(t?.indexPictureUrl).into(it) }

    }
}